package com.example.helloworld.controller;

import com.example.helloworld.service.Impl.CdzImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/cdz")
//允许跨域
@CrossOrigin
public class CdzController {
    @Autowired
    private CdzImpl cdz;

    @GetMapping("/GetAllCdzList")
    public Object getAllCdzList(String chargingGroupId, String expectedGoal){
        //根据chargingGroupId查询充电桩列
        return cdz.getAllCdz(chargingGroupId,expectedGoal);
    }

    @GetMapping("/GetCdzNameList")
    public Object getCdzNameList(){
        return cdz.getCdzNameList();
    }
}
